package com.chenjun.core.vo.sys;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.BeanUtils;

import com.chenjun.core.dao.generator.entity.SysRole;
/**
 * 
 * @Description: 
 * @author yanjinyin
 * @date 2017年7月23日 下午4:47:20
 */

@SuppressWarnings("serial")
public class RoleVo implements Serializable{
	
    /**
     * 角色设置表  
     * db_column: id 
     */	
	private String id;
    /**
     * 角色名称  
     * db_column: name 
     */	
	@NotEmpty(message="角色名称不能为空")
	private String name;
	/**
     * 角色类型 
     * db_column: type 
     */	
	@NotEmpty(message="角色类型不能为空")
	private String type;
    /**
     * 角色备注说明  
     * db_column: remarks 
     */	
	private String remarks;
    /**
     * 是否启用(0:启用;1:禁用)  
     * db_column: disabled 
     */	
	private String disabled;
    /**
     * 创建时间  
     * db_column: created_time 
     */	
	private Date createdTime;
	
	public void setId(String id) {
		this.id = id == null ? null : id.trim();
	}
	
	public String getId() {
		return this.id;
	}
	public void setName(String name) {
		this.name = name == null ? null : name.trim();
	}
	
	public String getName() {
		return this.name;
	}
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks == null ? null : remarks.trim();
	}
	
	public String getRemarks() {
		return this.remarks;
	}
	public void setDisabled(String disabled) {
		this.disabled = disabled == null ? null : disabled.trim();
	}
	
	public String getDisabled() {
		return this.disabled;
	}
	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}
	
	public Date getCreatedTime() {
		return this.createdTime;
	}
	
	/**
	 * 根据Bean获取Model模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static RoleVo getDtoByModel(SysRole source) throws IllegalAccessException, InvocationTargetException{
		RoleVo target = new RoleVo();
		BeanUtils.copyProperties(source, target);
		return target;
	}
	
	
	/**
	 * 根据Model获取Bean模型
	 * @return
	 * PayBean
	 * @throws InvocationTargetException 
	 * @throws IllegalAccessException 
	 */
	public static SysRole getModelByDto(RoleVo source) throws IllegalAccessException, InvocationTargetException{
		SysRole target = new SysRole();
		BeanUtils.copyProperties(source, target);
		return target;
	}

}
